package com.ma.service;

import com.ma.po.Blog;
import com.ma.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    //CRUD
    Blog getBlog(Long id);

    Blog saveBlog(Blog blog);

    Blog updateBlog(Long id,Blog blog);

    void deleteBlog(Long id);


    //分页查询
    //blog中封装查询条件
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    Page<Blog> listBlog(Pageable pageable);

    Page<Blog> listBlog(String query,Pageable pageable);
    Page<Blog> listBlog(Long id,Pageable pageable);

    List<Blog> listRecommendBlogTop(Integer size);

    Blog getAndConvert(Long id);

    //    对所有的数据进行归档因此不需要传参数
    Map<String ,List<Blog>> archiveBlog();

    //发布的博客数目  判断状态
    int countBlog();

}
